from datetime import datetime
import json
import base64
import time
import jwt
from jwt.exceptions import InvalidSignatureError

encoded_jwt = jwt.encode({'some': 'payload', 'exp': datetime.utcnow()}, 'secret', algorithm='HS256')

try:
    print(jwt.decode(encoded_jwt, 'secret', leeway=7, algorithms=['HS256']))
except InvalidSignatureError:
    print("错误")

